package com.vshining.cryptoki.jna.pkcs11t;

import com.sun.jna.NativeLong;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;

import java.util.Arrays;
import java.util.List;

/**
 * @author Shining Wang <shiningwang@vshining.com>
 */
@SuppressWarnings("unused")
public class CK_C_INITIALIZE_ARGS extends Structure {

    public CK_CREATEMUTEX CreateMutex;
    public CK_DESTROYMUTEX DestroyMutex;
    public CK_LOCKMUTEX LockMutex;
    public CK_UNLOCKMUTEX UnlockMutex;
    public NativeLong flags;
    public Pointer pReserved;

    @Override
    protected List getFieldOrder() {
        return Arrays.asList(
                "CreateMutex",
                "DestroyMutex",
                "LockMutex",
                "UnlockMutex",
                "flags",
                "pReserved"
        );
    }

    public static final long CKF_LIBRARY_CANT_CREATE_OS_THREADS = 0x00000001L;
    public static final long CKF_OS_LOCKING_OK = 0x00000002L;

}
